<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"
        integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk"
        crossorigin="anonymous">
  <link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css"
        integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
        crossorigin="anonymous">
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
        integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN"
        crossorigin="anonymous">

  <title>Facility Location - OptaPlanner Quarkus quickstart</title>
</head>
<body>

<div class="sticky-top d-flex justify-content-center align-items-center">
  <div id="notificationPanel" style="position: absolute; top: .5rem;"></div>
</div>

<div class="container-fluid">
  <div class="row">
    <div class="col-7 col-lg-8 col-xl-9">
      <div id="map" style="width: 100%; height: 100vh;"></div>
    </div>
    <div class="col-5 col-lg-4 col-xl-3" style="height: 100vh; overflow-y: scroll;">
      <div class="row pt-2 row-cols-1">
        <div class="col mb-3">
          <button id="solveButton" type="button" class="btn btn-success">
            <i class="fa fa-play"></i> Solve
          </button>
          <button id="stopSolvingButton" type="button" class="btn btn-danger">
            <i class="fa fa-stop"></i> Stop solving
          </button>
        </div>
        <div class="col">
          <h5>
            Solution summary
            <a href="#" class="float-right" data-toggle="modal" data-target="#scoreDialog">
              <i class="fa fa-info-circle"></i>
            </a>
          </h5>
          <table class="table">
            <tr>
              <td>Score:</td>
              <td><span id="score">unknown</span></td>
            </tr>
            <tr>
              <td>Total cost:</td>
              <td><span id="cost">unknown</span> (<span id="cost-percentage">unknown</span>%)</td>
            </tr>
            <tr>
              <td>Total distance:</td>
              <td><span id="distance">unknown</span></td>
            </tr>
          </table>
        </div>
        <div class="col">
          <h5>Facility list</h5>
          <table class="table-sm w-100">
            <thead>
            <tr>
              <th style="width: 1rem"></th>
              <th>Name</th>
              <th>Usage</th>
              <th class="text-right">Setup cost</th>
            </tr>
            </thead>
            <tbody id="facilities"></tbody>
          </table>
        </div>
      </div>
    </div>
  </div>
</div>

<div class="modal fade" id="scoreDialog" tabindex="-1" role="dialog">
  <div class="modal-dialog modal-lg" role="dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h5>Score explanation</h5>
        <button type="button" class="close" data-dismiss="modal">
          <span>&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <pre id="scoreInfo">
        </pre>
      </div>
    </div>
  </div>
</div>

<script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js" integrity="sha512-gZwIG9x3wUXg2hdXF6+rVkLF/0Vi9U8D2Ntg4Ga5I5BZpVkVxlJWbSQtXPSiUTtC0TjtGOmxa1AJPuV0CPthew==" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
<script src="app.js" type="text/javascript"></script>
</body>
</html>
